<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="list">
        <p>p1</p>
        <p>p2</p>
        <p>p2</p>
        <p>p2</p>
        <p>p2</p>
    </div>

</body>

</html>
<script src="jquery.min.js"></script>
<script>
    // jQury相当于$
    // .addclass给p直接加上类名不需要循环
    $(".list p").addClass("和嘿嘿")
</script>